#include "widget.h"
#include "ui_widget.h"
#include "teacher.h"
#include "student.h"
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    this->tch = new Teacher(this);
    this->stu = new Student(this);

    QPushButton *btn = new QPushButton("上课了", this);
    resize(800, 600);
    btn->move(100, 100);

    connect(tch,&Teacher::MySignals, stu, &Student::StartStudy);
    connect(btn,&QPushButton::clicked,tch,&Teacher::MySignals);
    EmitSignal();
}

void Widget::EmitSignal()
{
    emit tch->MySignals();
}

Widget::~Widget()
{
    delete ui;
}
